package com.example.covid19.util;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class RabbitMqUtil {

    @Resource
    private RabbitTemplate rabbitTemplate;

    public <T> void sendMsg(String exchange, String router, T msg) {
        System.out.println(msg);
        rabbitTemplate.convertAndSend(exchange, router, msg);
    }
}
